home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK1.toast / Development Kits (Disc 1) / QuickDraw 3D / Development / Interfaces / QD3DPascalInterfaces / QD3DView.p < prev    next >
Encoding:
Text File  |  1996-11-15  |  10.5 KB  |  244 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        QD3DView.p
  3.  
  4.      Contains:    View types and routines                                            
  5.  
  6.      Version:    Technology:    Quickdraw 3D 1.0.6
  7.                  Release:    Universal Interfaces 2.1.5d1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT QD3DView;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __QD3DVIEW__}
  28. {$SETC __QD3DVIEW__ := 1}
  29.  
  30. {$I+}
  31. {$SETC QD3DViewIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __QD3D__}
  35. {$I QD3D.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __QD3DSTYLE__}
  38. {$I QD3DStyle.p}
  39. {$ENDC}
  40. {$IFC UNDEFINED __QD3DSET__}
  41. {$I QD3DSet.p}
  42. {$ENDC}
  43.  
  44. {$PUSH}
  45. {$ALIGN POWER}
  46. {$LibExport+}
  47.  
  48. {
  49. *****************************************************************************
  50.  **                                                                             **
  51.  **                        View Type Definitions                                 **
  52.  **                                                                             **
  53.  ****************************************************************************
  54. }
  55.  
  56. TYPE
  57.     TQ3ViewStatus                 = LONGINT;
  58. CONST
  59.     kQ3ViewStatusDone            = {TQ3ViewStatus}0;
  60.     kQ3ViewStatusRetraverse        = {TQ3ViewStatus}1;
  61.     kQ3ViewStatusError            = {TQ3ViewStatus}2;
  62.     kQ3ViewStatusCancelled        = {TQ3ViewStatus}3;
  63.  
  64. {
  65. *****************************************************************************
  66.  **                                                                             **
  67.  **                        Default Attribute Set                                 **
  68.  **                                                                             **
  69.  ****************************************************************************
  70. }
  71. {
  72. *****************************************************************************
  73.  **                                                                             **
  74.  **                            View Routines                                     **
  75.  **                                                                             **
  76.  ****************************************************************************
  77. }
  78. FUNCTION Q3View_New: TQ3ViewObject; C;
  79. FUNCTION Q3View_Cancel(view: TQ3ViewObject): TQ3Status; C;
  80. {
  81. *****************************************************************************
  82.  **                                                                             **
  83.  **                        View Rendering routines                                 **
  84.  **                                                                             **
  85.  ****************************************************************************
  86. }
  87. FUNCTION Q3View_SetRendererByType(view: TQ3ViewObject; theType: TQ3ObjectType): TQ3Status; C;
  88. FUNCTION Q3View_SetRenderer(view: TQ3ViewObject; renderer: TQ3RendererObject): TQ3Status; C;
  89. FUNCTION Q3View_GetRenderer(view: TQ3ViewObject; VAR renderer: TQ3RendererObject): TQ3Status; C;
  90. FUNCTION Q3View_StartRendering(view: TQ3ViewObject): TQ3Status; C;
  91. FUNCTION Q3View_EndRendering(view: TQ3ViewObject): TQ3ViewStatus; C;
  92. FUNCTION Q3View_Flush(view: TQ3ViewObject): TQ3Status; C;
  93. FUNCTION Q3View_Sync(view: TQ3ViewObject): TQ3Status; C;
  94. {
  95. *****************************************************************************
  96.  **                                                                             **
  97.  **                        View/Bounds/Pick routines                             **
  98.  **                                                                             **
  99.  ****************************************************************************
  100. }
  101. FUNCTION Q3View_StartBoundingBox(view: TQ3ViewObject; computeBounds: TQ3ComputeBounds): TQ3Status; C;
  102. FUNCTION Q3View_EndBoundingBox(view: TQ3ViewObject; VAR result: TQ3BoundingBox): TQ3ViewStatus; C;
  103. FUNCTION Q3View_StartBoundingSphere(view: TQ3ViewObject; computeBounds: TQ3ComputeBounds): TQ3Status; C;
  104. FUNCTION Q3View_EndBoundingSphere(view: TQ3ViewObject; VAR result: TQ3BoundingSphere): TQ3ViewStatus; C;
  105. FUNCTION Q3View_StartPicking(view: TQ3ViewObject; pick: TQ3PickObject): TQ3Status; C;
  106. FUNCTION Q3View_EndPicking(view: TQ3ViewObject): TQ3ViewStatus; C;
  107. {
  108. *****************************************************************************
  109.  **                                                                             **
  110.  **                            View/Camera routines                             **
  111.  **                                                                             **
  112.  ****************************************************************************
  113. }
  114. FUNCTION Q3View_GetCamera(view: TQ3ViewObject; VAR camera: TQ3CameraObject): TQ3Status; C;
  115. FUNCTION Q3View_SetCamera(view: TQ3ViewObject; camera: TQ3CameraObject): TQ3Status; C;
  116. {
  117. *****************************************************************************
  118.  **                                                                             **
  119.  **                            View/Lights routines                             **
  120.  **                                                                             **
  121.  ****************************************************************************
  122. }
  123. FUNCTION Q3View_SetLightGroup(view: TQ3ViewObject; lightGroup: TQ3GroupObject): TQ3Status; C;
  124. FUNCTION Q3View_GetLightGroup(view: TQ3ViewObject; VAR lightGroup: TQ3GroupObject): TQ3Status; C;
  125. {
  126. *****************************************************************************
  127.  **                                                                             **
  128.  **        Idle Method                                                             **
  129.  **                                                                             **
  130.  **        These allow the application to register callback routines which will **
  131.  **        be called by the view during especially long operations.             **
  132.  **                                                                             **
  133.  **        These are used to interrupt long renderings or traversals.  Inside     **
  134.  **        the idler callback the application can check for command-period or     **
  135.  **        whatever else they may be using to let the user interrupt rendering. **
  136.  **                                                                             **
  137.  **        It is NOT LEGAL to call QD3D routines inside an idler callback.         **
  138.  **        Return kQ3Failure to cancel rendering.                                 **
  139.  **                                                                             **
  140.  **        Q3View_SetIdleMethod registers a callback that can be called         **
  141.  **        by the system during rendering.  Unfortunately there is no way yet     **
  142.  **        to set timer intervals when you want to be called.  Basically, it is **
  143.  **        up to the application's idler callback to check clocks to see if you **
  144.  **        were called back only a millisecond ago or an hour ago!                 **
  145.  **                                                                             **
  146.  ****************************************************************************
  147. }
  148.  
  149. TYPE
  150.     TQ3ViewIdleMethod = ProcPtr;  { FUNCTION TQ3ViewIdleMethod(view: TQ3ViewObject; idlerData: UNIV Ptr): TQ3Status; C; }
  151.  
  152. FUNCTION Q3View_SetIdleMethod(view: TQ3ViewObject; idleMethod: TQ3ViewIdleMethod; idleData: UNIV Ptr): TQ3Status; C;
  153. {
  154. *****************************************************************************
  155.  **                                                                             **
  156.  **                            Push/Pop routines                                 **
  157.  **                                                                             **
  158.  ****************************************************************************
  159. }
  160. FUNCTION Q3Push_Submit(view: TQ3ViewObject): TQ3Status; C;
  161. FUNCTION Q3Pop_Submit(view: TQ3ViewObject): TQ3Status; C;
  162. {
  163. *****************************************************************************
  164.  **                                                                             **
  165.  **        Check if bounding box is visible in the viewing frustum.  Transforms **
  166.  **        the bbox by the current local_to_world transformation matrix and     **
  167.  **        does a clip test to see if it lies in the viewing frustum.             **
  168.  **        This can be used by applications to cull out large chunks of scenes     **
  169.  **        that are not going to be visible.                                     **
  170.  **                                                                             **
  171.  **        The default implementation is to always return kQ3True.  Renderers     **
  172.  **        may override this routine however to do the checking.                 **
  173.  **                                                                             **
  174.  ****************************************************************************
  175. }
  176. FUNCTION Q3View_IsBoundingBoxVisible(view: TQ3ViewObject; {CONST}VAR bbox: TQ3BoundingBox): TQ3Boolean; C;
  177. {
  178. *****************************************************************************
  179.  **                                                                             **
  180.  **                            DrawContext routines                             **
  181.  **                                                                             **
  182.  ****************************************************************************
  183. }
  184. FUNCTION Q3View_SetDrawContext(view: TQ3ViewObject; drawContext: TQ3DrawContextObject): TQ3Status; C;
  185. FUNCTION Q3View_GetDrawContext(view: TQ3ViewObject; VAR drawContext: TQ3DrawContextObject): TQ3Status; C;
  186. {
  187. *****************************************************************************
  188.  **                                                                             **
  189.  **                            Graphics State routines                             **
  190.  **                                                                             **
  191.  ** The graphics state routines can only be called while rendering (ie. in     **
  192.  ** between calls to start and end rendering calls).  If they are called     **
  193.  ** outside of a rendering loop, they will return with error.                 **
  194.  **                                                                             **
  195.  ****************************************************************************
  196. }
  197. {
  198. *****************************************************************************
  199.  **                                                                             **
  200.  **                            Transform routines                                 **
  201.  **                                                                             **
  202.  ****************************************************************************
  203. }
  204. FUNCTION Q3View_GetLocalToWorldMatrixState(view: TQ3ViewObject; VAR matrix: TQ3Matrix4x4): TQ3Status; C;
  205. FUNCTION Q3View_GetWorldToFrustumMatrixState(view: TQ3ViewObject; VAR matrix: TQ3Matrix4x4): TQ3Status; C;
  206. FUNCTION Q3View_GetFrustumToWindowMatrixState(view: TQ3ViewObject; VAR matrix: TQ3Matrix4x4): TQ3Status; C;
  207. {
  208. *****************************************************************************
  209.  **                                                                             **
  210.  **                            Style state routines                             **
  211.  **                                                                             **
  212.  ****************************************************************************
  213. }
  214. FUNCTION Q3View_GetBackfacingStyleState(view: TQ3ViewObject; VAR backfacingStyle: TQ3BackfacingStyle): TQ3Status; C;
  215. FUNCTION Q3View_GetInterpolationStyleState(view: TQ3ViewObject; VAR interpolationType: TQ3InterpolationStyle): TQ3Status; C;
  216. FUNCTION Q3View_GetFillStyleState(view: TQ3ViewObject; VAR fillStyle: TQ3FillStyle): TQ3Status; C;
  217. FUNCTION Q3View_GetHighlightStyleState(view: TQ3ViewObject; VAR highlightStyle: TQ3AttributeSet): TQ3Status; C;
  218. FUNCTION Q3View_GetSubdivisionStyleState(view: TQ3ViewObject; VAR subdivisionStyle: TQ3SubdivisionStyleData): TQ3Status; C;
  219. FUNCTION Q3View_GetOrientationStyleState(view: TQ3ViewObject; VAR fontFacingDirectionStyle: TQ3OrientationStyle): TQ3Status; C;
  220. FUNCTION Q3View_GetReceiveShadowsStyleState(view: TQ3ViewObject; VAR receives: TQ3Boolean): TQ3Status; C;
  221. FUNCTION Q3View_GetPickIDStyleState(view: TQ3ViewObject; VAR pickIDStyle: LONGINT): TQ3Status; C;
  222. FUNCTION Q3View_GetPickPartsStyleState(view: TQ3ViewObject; VAR pickPartsStyle: TQ3PickParts): TQ3Status; C;
  223. {
  224. *****************************************************************************
  225.  **                                                                             **
  226.  **                        Attribute state routines                             **
  227.  **                                                                             **
  228.  ****************************************************************************
  229. }
  230. FUNCTION Q3View_GetDefaultAttributeSet(view: TQ3ViewObject; VAR attributeSet: TQ3AttributeSet): TQ3Status; C;
  231. FUNCTION Q3View_SetDefaultAttributeSet(view: TQ3ViewObject; attributeSet: TQ3AttributeSet): TQ3Status; C;
  232. FUNCTION Q3View_GetAttributeSetState(view: TQ3ViewObject; VAR attributeSet: TQ3AttributeSet): TQ3Status; C;
  233. FUNCTION Q3View_GetAttributeState(view: TQ3ViewObject; attributeType: TQ3AttributeType; data: UNIV Ptr): TQ3Status; C;
  234. {$ALIGN RESET}
  235. {$POP}
  236.  
  237. {$SETC UsingIncludes := QD3DViewIncludes}
  238.  
  239. {$ENDC} {__QD3DVIEW__}
  240.  
  241. {$IFC NOT UsingIncludes}
  242.  END.
  243. {$ENDC}
  244.